From 2aace4b33234585dbac8666613f75e45d0b4e681 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Mon, 5 Sep 2005 15:32:14 +0000 Subject: [PATCH] On suspend, canonicalize store and console mfns in the guest. Signed-off-by: Christian Limpach --- linux-2.6-xen-sparse/arch/xen/kernel/reboot.c | 3 ++ tools/libxc/xc_linux_save.c | 28 ------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c index 88337fbe29..df0d233748 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c @@ -177,6 +177,9 @@ static int __do_suspend(void *ignore) HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page; clear_fixmap(FIX_SHARED_INFO); + xen_start_info.store_mfn = mfn_to_pfn(xen_start_info.store_mfn); + xen_start_info.console_mfn = mfn_to_pfn(xen_start_info.console_mfn); + /* We'll stop somewhere inside this hypercall. When it returns, we'll start resuming after the restore. */ HYPERVISOR_suspend(virt_to_mfn(xen_start_info)); diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c index 6eac306062..c9af7b0d3b 100644 --- a/tools/libxc/xc_linux_save.c +++ b/tools/libxc/xc_linux_save.c @@ -434,9 +434,6 @@ int xc_linux_save(int xc_handle, int io_fd, u32 dom, u32 max_iters, /* base of the region in which domain memory is mapped */ unsigned char *region_base = NULL; - /* A temporary mapping of the guest's start_info page. */ - start_info_t *start_info = NULL; - /* number of pages we're dealing with */ unsigned long nr_pfns; @@ -669,28 +666,6 @@ int xc_linux_save(int xc_handle, int io_fd, u32 dom, u32 max_iters, goto out; } - /* Map the suspend-record MFN to pin it. The page must be owned by - dom for this to succeed. */ - start_info = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE, - PROT_READ | PROT_WRITE, - ctxt.user_regs.esi); - if (!start_info){ - ERR("Couldn't map start_info page"); - goto out; - } - - /* Canonicalize store mfn. */ - if ( !translate_mfn_to_pfn(&start_info->store_mfn) ) { - ERR("Store frame is not in range of pseudophys map"); - goto out; - } - - /* Canonicalize console mfn. */ - if ( !translate_mfn_to_pfn(&start_info->console_mfn) ) { - ERR("Console frame is not in range of pseudophys map"); - goto out; - } - print_stats( xc_handle, dom, 0, &stats, 0 ); /* Now write out each data page, canonicalising page tables as we go... */ @@ -1062,9 +1037,6 @@ int xc_linux_save(int xc_handle, int io_fd, u32 dom, u32 max_iters, if(live_shinfo) munmap(live_shinfo, PAGE_SIZE); - if(start_info) - munmap(start_info, PAGE_SIZE); - if(live_pfn_to_mfn_frame_list) munmap(live_pfn_to_mfn_frame_list, PAGE_SIZE); -- 2.30.2